{% extends 'base.html' %}
{% load static %}

{% block extra_css %}
<link rel="stylesheet" href="{% static 'css/user_comments.css' %}">
{% endblock %}

{% block content %}
<div class="checklist">
    <ul>
        {% for comment in comments %}
            <li class="comment-box">
                <!-- 帖子标题 -->
                <div class="post-title">
                    <a href="{% url 'forum:post_detail' comment.post.pk %}">标题：{{ comment.post.title }}</a>
                </div>
                
                <!-- 用户评论内容 + 删除按钮 -->
                <div class="comment-content">
                    <p>{{ comment.content }}</p>
                    <form action="{% url 'forum:delete_comment' comment.pk %}" method="post" class="delete-btn">
                        {% csrf_token %}
                        <button type="submit">删除</button>
                    </form>
                </div>
            </li>
        {% empty %}
            <p>你还没有发布过评论。</p>
        {% endfor %}
    </ul>
</div>
{% endblock %}